<?php

global $page_path,  $system_class_path,   $root_path,     $template_path,        $module_view_ext, $module_class_ext, 
       $_Q_script,  $_Q_css, 	          $_Q_title,      $_Q_ext_module,        $_Q_page,         $page_default,
       $_Q_view,    $_Q_js_path,          $_Q_css_path,   $template_page_path,   $_Q_module_path,  $_Q_, 
       $_Q_module,  $_Q_html_class,       $base_path,     $_Q_HeaderScript,      $base_url,        $_Q_Url;

$system_class_path = "system/class";
// Include/Init System class
include $system_class_path."/html_class.cl";
include $system_class_path."/_Q_.cl";
include $system_class_path."/_Q_url.cl";
$_Q_html_class = new html();
$_Q_ = new _Q_();
$_Q_Url = new _Q_Url();

// Version 1 : Variable
$page_path   	  = "pages";
$page_default	  = "default";
$root_path        = dirname(__FILE__) . "/";
$template_path	  = "template/default/";
$module_view_ext  = ".pg";
$module_class_ext = ".cl";


$_Q_title      = "Q Project";
$_Q_ext_module = array();
$page 	       = (isset($_REQUEST['page']) && $_REQUEST['page'])?$_REQUEST['page']:$page_default;

// Include / Require
$_Q_page            = $page_path."/".$page."/";
$_Q_module          = $_Q_page."module/".$page.$module_class_ext;
$_Q_view            = $_Q_page."view/".$page.$module_view_ext;

// Path
$base_path = ""; // Use for subfolder - exam : "subfolder_name/"
if( $_SERVER['SERVER_PORT'] == 443 || @$_SERVER['HTTPS'] == 'on' || @strstr( $page, "checkout." )) {
	$base_url = "https://".$_SERVER["HTTP_HOST"]."/".$base_path;
} else {
	$base_url = "http://".$_SERVER["HTTP_HOST"]."/".$base_path;
}
$_Q_module_path     = $_Q_page."module/";
$_Q_model_path      = $_Q_page."model/";
$_Q_js_path         = "/".($base_path?$base_path."/":"").$page_path."/".$page."/js/";
$_Q_css_path        = "/".($base_path?$base_path."/":"").$page_path."/".$page."/css/";
$template_page_path = $page_path."/".$page."/view/template/";

// Version 2 : Object
$_Q_Url->_page($_Q_page);
$_Q_Url->_page_root($page_path);
$_Q_Url->_page_template($template_page_path);
$_Q_Url->_page_model($_Q_model_path);
$_Q_Url->_page_module($_Q_module_path);
$_Q_Url->_page_js($_Q_js_path);
$_Q_Url->_page_css($_Q_css_path);
$_Q_Url->_template($template_path);
$_Q_Url->_base($base_url,$root_path);
$_Q_Url->_system($system_class_path);

//define('QPATH_BASE', dirname(__FILE__) );
//echo QPATH_BASE;
//
//define( 'DS', DIRECTORY_SEPARATOR );
//echo "<pre>";
//var_dump($_Q_Url);
//echo "</pre>";

// _Q_ script
$_Q_HeaderScript    = TRUE;
// Just enter name of files, separate with ","
$_Q_script          = "jquery-1.4.2.min";
$_Q_css             = "main";
?>